import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import path from 'path';
// import UnoCss from 'unocss/vite'
// https://vitejs.dev/config/
export default defineConfig(async () => {
  // Dynamically import the ESM package
  const ReactivityTransform = (await import('@vue-macros/reactivity-transform/vite')).default;
  // const UnoCss = await import('unocss/vite').then(i => i.default)
  return {
    plugins: [
        uni(),
        // UnoCss(),
        ReactivityTransform()
    ],
    define: {
      "process.env.VUE_APP_TEST": JSON.stringify("test"),
    },
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `
            $silence-deprecations: ('legacy-js-api', 'import');
          `,
          api: 'modern',
          quietDeps: true
        }
      }
    },
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src'),
        'sass': require.resolve('sass')
      }
    }
  };
});